package com.itheima.health.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LoginAop {

    @Pointcut("execution( * com.itheima.health..login(..))")
    private void loginSuccess(){}

    /**
     * 记录用户的登录日志 什么人在什么时候登录系统
     */
    @Around("loginSuccess()")
    public Object logLogin(ProceedingJoinPoint pjp) throws Throwable {
        //System.out.println("切面打印");
        Object proceed = pjp.proceed();
        //System.out.println("切面打印222222222222222222222222222222222222222222");
        //存入日志
//        pjp.getArgs()
        return proceed;
    }
}
